<!DOCTYPE html>
<html>
	<head>
		<title>getTextFile test</title>
		<script src="js/jquery-1.9.1.min.js"></script>
		<script>
		$(function() {
			$.get('news_sample.txt', function(data) {
			   //alert(data);
			   //process text file line by line
			   var lines = data.split("\n");
			   //alert(lines);
			   for (var i = 0, len = lines.length; i < len; i++) {
            		if(lines[i]!='')
            			$('#news ul').append("<li>"+lines[i]+"</li>");
        		}
			   //$('#news').html(data.replace('\n','<br>'));
			}).fail(function() {
				    alert( "errore lettura file news" );
			}).always(function() {
			    alert( "finito" );
			});
		});
		</script>
	</head>
	<body>
		<div id="news">
			<ul>	
			</ul>
		</div>
	</body>
</html>